<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>关注-ylbnotesHub</title>
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/css/mycss.css}">
    <link rel="stylesheet" th:href="@{/zplayer/css/zplayer.min.css}">
    <script th:src="@{/zplayer/js/zplayer.min.js}"></script>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_2080705_x7u3h1yrrfc.css">
</head>
<body>
    <div th:replace="~{common/header::header(activeUrl='follow')}"></div>

    <div class="container">

        <div class="row">
            <div class="col-md-2">
                <div th:replace="~{index::bar}"></div>
            </div>
            <div class="col-md-8">
                <br>
                <hr class="layui-bg-blue">

                <div class="blog-main">

                    <div class="my-3 p-3 bg-white rounded shadow-sm">

                        <bg sec:authorize="!isAuthenticated()">
                            <div>
                                登录看看关注的人发了什么~
                            </div>
                        </bg>
                        <bg sec:authorize="isAuthenticated()">
                            <div th:if="${blogs.getDatas().size()<=0}">
                                <div class="media text-muted pt-3">这里空空如也~ &emsp;&emsp;
                                </div>
                            </div>
                            <div th:if="${blogs.getDatas().size()>0}">
                                <div th:each="blog:${blogs.getDatas()}" class="media text-muted pt-3">


                                    <p th:if="${blog.getSort()==0}" class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray" style="margin-left: 5px">
                                        <!-- 标题 -->
                                        <a th:text="${blog.getTitle()}" style="font-size: 14px"
                                           th:href="@{'/article/read/'+${blog.getBid()}+'/'+${blog.getAuthorId()}}"
                                           class="text-dark font-weight-bold text-decoration-none d-block">
                                        </a>
                                        <br>
                                        <!-- 头像 -->
                                        <img th:src="${blog.getAuthorAvatar()}" style="border-radius: 5px " width="18" height="18">

                                        <a th:text="${blog.getAuthorName()}" style="font-size: 13px"
                                           th:href="@{'/article/'+${blog.getAuthorId()}}"
                                           class="text-dark font-weight-bold text-decoration-none" target="_blank">
                                        </a>

                                        <span th:text="${blog.getOriginal()==1?'原创':''}"
                                              class="badge badge-light u-content-tab">
                                    </span>&emsp;
                                        <!--内容摘要-->
                                        <span th:text="${#strings.abbreviate(blog.getContent(),25)}"
                                              class="badge u-content-zy">
                                    </span>
                                        <!-- 时间 -->
                                        <!--<span th:text="${#dates.format(blog.getUpdateTime(),'yyyy-MM-dd HH:mm:ss')}"-->
                                        <!--class="badge badge-light u-content-tab">-->
                                        <!--</span>&emsp;-->

                                        <!--评论量-->
                                        <span class="float-right"><i class="iconfont icon-pinglunliang" style="font-size: 13px"></i>
                                        [[${blog.getComment()}]]
                                    </span>

                                        <span class="float-right"><i class="iconfont icon-shoucang1" style="font-size: 12px;"></i>
                                        [[${blog.getCollect()}]]&emsp;
                                    </span>
                                        <!-- 浏览量 -->
                                        <span class="float-right"><i class="iconfont icon-liulan" style="font-size: 12px;"></i>
                                        [[${blog.getViews()}]]&emsp;

                                    </span>
                                    </p>
                                </div>

                                <!--分页-->
                                <nav aria-label="Page navigation example" class="mt-4">
                                    <ul class="pagination justify-content-center pagination-sm">
                                        <li th:class="${blogs.getPageInfo().isHasPreviousPage()==true?'page-item':'page-item disabled'}">
                                            <a class="page-link" th:href="@{'/tofollow/'+${session.loginUser.getUid()}+'/'+${blogs.getPageInfo().pageNum -1}+'/10'}" tabindex=""><&nbsp;</a>
                                        </li>
                                        <li class="page-item" th:if="${blogs.getPageInfo().isHasPreviousPage()}">
                                            <a class="page-link" th:href="@{'tofollow/'+${session.loginUser.getUid()}+'/'+${blogs.getPageInfo().pageNum -1}+'/10'}" th:text="${blogs.getPageInfo().pageNum -1}"></a>
                                        </li>
                                        <li class="page-item active">
                                            <a class="page-link" th:href="@{'/tofollow/'+${session.loginUser.getUid()}+'/'+${blogs.getPageInfo().pageNum}+'/10'}" th:text="${blogs.getPageInfo().pageNum}"></a>
                                        </li>
                                        <li class="page-item" th:if="${blogs.getPageInfo().isHasNextPage()}">
                                            <a class="page-link" th:href="@{'/tofollow/'+${session.loginUser.getUid()}+'/'+${blogs.getPageInfo().pageNum +1}+'/10'}" th:text="${blogs.getPageInfo().pageNum +1}"></a>
                                        </li>
                                        <li th:class="${blogs.getPageInfo().isHasNextPage()==true?'page-item':'page-item disabled'}">
                                            <a class="page-link"  th:href="@{'/tofollow/'+${session.loginUser.getUid()}+'/'+${blogs.getPageInfo().pageNum +1}+'/10'}" >&nbsp;></a>
                                        </li>
                                    </ul>
                                </nav>
                            </div>
                        </bg>
                    </div>
                </div>
            </div>
        </div>

        <hr class="layui-bg-blue">

        <div th:replace="common/musicPlayer::musicPlayer"></div>
    </div>

    <div th:replace="~{common/footer::footer}"></div>

    <a class="to-top"><i class="iconfont icon-fanhuidingbu1" style="font-size:50px;color: #007bff"></i></a>
    <script th:src="@{/js/jquery-3.5.1.min.js}"></script>
    <script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
    <script th:src="@{/js/toTop.js}"></script>
    <script th:src="@{/layui/layui.all.js}"></script>
</body>
</html>